// pages/shenhe/shenhe.js
var that;
Page({

  /**
   * 页面的初始数据
   */
  data: {

  },
  nav_guanli(e){
    console.log(e.currentTarget.id)
    if (e.currentTarget.id == 0) {
      wx.redirectTo({
        url: '/pages/administration/shenhe/shenhe',
      })
    }else if (e.currentTarget.id == 1) {
      wx.redirectTo({
        url: '/pages/administration/chat_list/chat_list',
      })
    }else if (e.currentTarget.id == 2) {
      wx.redirectTo({
        url: '/pages/administration/invitation_list/invitation_list',
      })
    }
  },
  /**
   * 生命周期函数--监听页面加载
   */
  onLoad: function (options) {
    that=this
  },
  nav(e){
    console.log('e',e)
    wx.setStorageSync('seeuserInfo', e.currentTarget.dataset.item)
    wx.navigateTo({
      url: '/pages/administration/shenhe/shenheDetail',
    })
  },
  /**
   * 生命周期函数--监听页面显示
   */
  onShow: function () {
    wx.cloud.callFunction({
      name: "get_user",
      data: {},
      success(res) {
        console.log('个人信息-------------',res.result.data)
        res.result.data =res.result.data.reverse()
        var arr =[]
        res.result.data.forEach(item=>{
          if(item.userInfoDetail&&item.userInfoDetail.nicheng){
            arr.push(item)
          }
        })
        that.setData({
          list2:res.result.data,
          list:arr
        })
      },fail(err){
        console.log('个人信息-------------',err)
     
      }
    })
  },

})